<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet"
	href="<%=path %>/res/common/css/bootstrap.min.css">
<script src="<%=path %>res/common/js/bootstrap.min.js"></script>
</head>

<body style="margin: 0px">
<body style="position: relative;">
		<table class="table table-striped">
		<tr>
			<th colspan="5" style="text-align: center;">个人信息</th>
		</tr>
			<tr>
				<td><span style="font-weight:bold">学生姓名</span></td>
				<td><span>${stu.stuName}</span></td>
				<td>|</td>
				<td><span style="font-weight:bold">所属班级</span></td>
				<td><span>${stu.className}</span></td>
			</tr>
			<tr>
				<td><span style="font-weight:bold">粉丝数</span></td>
				<td><span>${stu.stuFans}</span></td>
				<td>|</td>
				<td><span style="font-weight:bold">关注数</span></td>
				<td><span>${stu.stuFocus}</span></td>
			</tr>
			<tr>
				<td><span style="font-weight:bold">博客地址</span></td>
				<td><span>${stu.blogAddress}</span></td>
				<td>|</td>
				<td><span style="font-weight:bold">博客数量</span></td>
				<td><span>${stu.blogNumber}</span></td>
			</tr>
		</table>
		
		<div class="panel panel-default">
		<div class="panel-heading">
			<h3 class="panel-title">个人信息修改</h3>
		</div>
		<div class="panel-body">
			<table class="table">
				<tr class="active">
					<td>
						<form action="<%=path %>/stuinformationUpdate" method="post" class="bs-example bs-example-form">
							<div class="col-sm-3">
								<div class="input-group">
									<span class="input-group-btn">
										<button class="btn btn-default" type="button"
											disabled="disabled">
											<span>${stu.stuName}</span>
										</button>
									</span> 
									<input name="stuid" value="${stu.stuId}" type="hidden"></input>
									<input name="updatename" type="text" class="form-control" placeholder="姓名">
									<span class="input-group-btn">
										<button class="btn btn-default" type="submit">修改</button>
									</span>
								</div>
							</div>
						</form> <br> <span
						style="margin-left: 50px; margin-top: -16px; font-size: 16px; color: gray;">——粉丝数:${stu.stuFans }</span>
						<span style="margin-left: 50px; font-size: 16px; color: gray;">——关注数:${stu.stuFocus }</span>

						<form action="<%=path %>/bloginformationUpdate" method="post" class="bs-example bs-example-form">
							<div class="col-sm-6">
								<div class="input-group">
									<span class="input-group-btn">
										<button class="btn btn-default" type="button"
											disabled="disabled">
											<span>${stu.blogAddress}</span>
										</button>
									</span> 
									<input name="stuid" value="${stu.stuId}" type="hidden"></input>
									<input type="text" class="form-control" name="updatename" placeholder="博客地址(修改后需重新拉取数据)">
									<span class="input-group-btn">
										<button class="btn btn-default" type="submit">修改</button>
									</span>
								</div>
							</div>
						</form> <span style="margin-left: 50px; font-size: 16px; color: gray;">——博客数量:${stu.blogNumber }</span>

						<form action="<%=path %>/classinformationUpdate" method="post" class="bs-example bs-example-form" role="form">
						<button class="btn btn-default" type="button"
											disabled="disabled" style="margin-left:-58.65%">
											<span>${stu.className}</span>
										</button>
							<div class="col-sm-6" style="margin-left: 10%">
									<div class="col-sm-6" style="display:inline">
									<input name="stuid" value="${stu.stuId}" type="hidden"></input>
										<select class="selectpicker show-tick form-control"
											name="updatename">
											<c:forEach var="li" items="${list}" begin="0"
												end="${list.size()}" varStatus="vs">
												<option value="${li.classId }">${li.className}</option>
											</c:forEach>
										</select>
									</div>
									<span class="input-group-btn">
										<button class="btn btn-default" type="submit">修改</button>
									</span>
							</div>
						</form>

					</td>
				</tr>
			</table>
		</div>
	</div>
	<%
	String classupdate = (String)request.getAttribute("classupdate"); 
	String stuupdate = (String)request.getAttribute("stuupdate"); 
	String blogupdate = (String)request.getAttribute("blogupdate"); 
	if (classupdate == "1") {
	%>
		<script type="text/javascript">
        	alert("班级修改成功");
		</script>
	<% 
	}
	if (blogupdate == "1") {
	%>
		<script type="text/javascript">
        	alert("博客地址修改成功");
		</script>
	<% 
	}
	if (stuupdate == "1") {
	%>
		<script type="text/javascript">
        	alert("学生姓名修改成功");
		</script>
	<% 
	}
	%>
</body>
</html>
